USE [ERP]
GO

/****** Object:  Table [dbo].[EmployeeLanguages]    Script Date: 11/16/2009 14:31:42 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[EmployeeLanguages](
	[EmployeeID] [nvarchar](50) NOT NULL,
	[LanguageID] [nvarchar](50) NOT NULL,
	[WritingScoreID] [nvarchar](50) NULL,
	[ReadingScoreID] [nvarchar](50) NULL,
	[CommunicationScoreID] [nvarchar](50) NULL,
	[Notes] [nvarchar](50) NULL,
 CONSTRAINT [PK_EmployeeLanguages] PRIMARY KEY CLUSTERED 
(
	[EmployeeID] ASC,
	[LanguageID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

ALTER TABLE [dbo].[EmployeeLanguages]  WITH CHECK ADD  CONSTRAINT [FK_EmployeeLanguages_Employees] FOREIGN KEY([EmployeeID])
REFERENCES [dbo].[Employees] ([ID])
GO

ALTER TABLE [dbo].[EmployeeLanguages] CHECK CONSTRAINT [FK_EmployeeLanguages_Employees]
GO

ALTER TABLE [dbo].[EmployeeLanguages]  WITH CHECK ADD  CONSTRAINT [FK_EmployeeLanguages_Languages] FOREIGN KEY([LanguageID])
REFERENCES [dbo].[Languages] ([ID])
GO

ALTER TABLE [dbo].[EmployeeLanguages] CHECK CONSTRAINT [FK_EmployeeLanguages_Languages]
GO

ALTER TABLE [dbo].[EmployeeLanguages]  WITH CHECK ADD  CONSTRAINT [FK_EmployeeLanguages_Scores] FOREIGN KEY([WritingScoreID])
REFERENCES [dbo].[Scores] ([ID])
GO

ALTER TABLE [dbo].[EmployeeLanguages] CHECK CONSTRAINT [FK_EmployeeLanguages_Scores]
GO

ALTER TABLE [dbo].[EmployeeLanguages]  WITH CHECK ADD  CONSTRAINT [FK_EmployeeLanguages_Scores1] FOREIGN KEY([ReadingScoreID])
REFERENCES [dbo].[Scores] ([ID])
GO

ALTER TABLE [dbo].[EmployeeLanguages] CHECK CONSTRAINT [FK_EmployeeLanguages_Scores1]
GO

ALTER TABLE [dbo].[EmployeeLanguages]  WITH CHECK ADD  CONSTRAINT [FK_EmployeeLanguages_Scores2] FOREIGN KEY([CommunicationScoreID])
REFERENCES [dbo].[Scores] ([ID])
GO

ALTER TABLE [dbo].[EmployeeLanguages] CHECK CONSTRAINT [FK_EmployeeLanguages_Scores2]
GO

